﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
public partial class test : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        generateCards();
    }

    public void generateCards()
    {
        string html;
        for (int i = 0; i < 10; i++)
        {
            Literal user = new Literal();
            html = createCard("Manipal", "Computer Science", "b.manipal@gmail.com");
            if (i % 5 == 0)
            {
                html = "<div class='row-fluid'>" + html;
            }
            else if((i+1)%5==0)
            {
                html = html + "</div>";
            }
            user.Text = html;
            this.users.Controls.Add(user);
        }
    }
    public String createCard(string name, string branch, string email)
    {
        string html = "<div class='card people'><div class='card-top green'><img src='images/silhouette_homer.png' alt='' /></div><div class='card-info'><a class='title' href='#'>" + name + "</a><div class='desc'>" + branch + "<br />" + email + "</div></div><div class='card-bottom'><a id="+email+" class='btn btn-block'>Message</a></div></div>";
        return html;
    }
     
}